<template>
  <div>
    <template v-for="(value, key) in items">
      <el-menu-item
        v-if="value.PAGE_TITLE"
        :key="key"
        :index="value.PAGE_TITLE"
      >
        <template slot="title">
          <i class="el-icon-menu"></i>
          <span>{{ key }}</span>
        </template>
      </el-menu-item>
      <el-submenu v-else :key="key" :index="key + '_menu'">
        <template slot="title">{{ key }}</template>
        <menuItem :items="value" />
      </el-submenu>
    </template>
  </div>
</template>

<script>
export default {
  name: 'menuItem',
  data() {
    return {}
  },
  props: {
    items: {
      type: Object,
      required: true
    }
  }
}
</script>
